import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '考核指标',
    align:"center",
    dataIndex: 'assessindex'
  },
  {title: '评价细则',
    align:"center",
    dataIndex: 'commentrules'},
  {
    title: '责任部门',
    align:"center",
    dataIndex: 'respondepartment_dictText'
  },
   {
    title: '任务状态',
    align:"center",
    dataIndex: 'taskstatus'
   }
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '待办完成时间',
    field: 'tobedone_finishendtime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '任务状态',
    field: 'taskstatus',
    component: 'Input',
  },
  {
    label: '任务类型',
    field: 'tasktype',
    component: 'Input',
  },
  {
    label: '指标id',
    field: 'kpi_id',
    component: 'Input',
  },
  {
    label: '责任部门',
    field: 'respondepartment',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode:"sys_depart,depart_name,id"
    },
    dynamicDisabled:true
  },
  {
    label: '待办配合部门',
    field: 'coop_depart',
    component: 'JSelectMultiple',
    componentProps:{
      dictCode:"sys_depart where depart_name like '%部' or depart_name like '%处',depart_name,id"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  assessindex: {title: '考核指标',order: 0,view: 'text', type: 'string',},
  commentrules: {title: '评价细则',order: 1,view: 'text', type: 'string',},
  respondepartment: {title: '责任部门',order: 2,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',},
  finishedtime: {title: '待办完成时间',order: 3,view: 'datetime', type: 'string',},
  taskstatus: {title: '任务状态',order: 4,view: 'text', type: 'string',},
  coop_depart: {title: '待办配合部门',order: 5,view: 'list', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name'},
  tasktype: {title: '任务类型',order: 6,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
